package com.qianji.controller;

import com.qianji.comment.SendEmailComment;
import com.qianji.pojo.UserDto;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author 钟丽诗
 * @Date 2021.4.20
 */

@Slf4j
@RestController
@RequestMapping("sendEmail")
public class SendEmailController {

    @Autowired
    private SendEmailComment sendEmailComment;

    @ApiOperation("发送邮箱")
    @PostMapping("send")
    public Object sendEmail(String email){
        Map<String,Object> hashMap = new HashMap<>();

        String title = "邮箱发送标题";

        String identify = "发送的内容";

        //发送邮箱
        sendEmailComment.sendEmail(email,title,identify);
        hashMap.put("success",true);
        hashMap.put("message","邮箱发送成功");

        return hashMap;

    }

}

